home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / GETSTUFF.C < prev    next >
C/C++ Source or Header  |  1990-10-09  |  2KB  |  90 lines

  1. /* Get origin line and quote string functions */
  2.  
  3. #include "msgg.h"
  4. #include "twindow.h"
  5. #include "keys.h"
  6. #include "headedit.h"
  7.  
  8.  
  9.  
  10. void pascal get_origin (void) {
  11.  
  12.     char temp[60];
  13.     int returncode;
  14.     WINDOW *wnd;
  15.     FIELD *fld;
  16.  
  17.     strcpy(temp,origin);
  18.     wnd=establish_window(3,maxy-7,6,76);
  19.     set_border(wnd,3);
  20.     set_title(wnd," Default Origin ");
  21.     set_colors(wnd,BORDER,7,0,0);
  22.     display_window(wnd);
  23.     wcursor(wnd,0,0);
  24.     wprintf(wnd," F10 to change or ESC to exit");
  25. Again:
  26.     wprompt(wnd,1,2,"* Origin:");
  27.     fld=establish_field(wnd,14,2,msk59,origin,'a');
  28.     field_window(fld,"changeorig",40,6);
  29.     prep_template(wnd);
  30. AskOver:
  31.     returncode=data_entry(wnd);
  32.     if (returncode==ESC) goto Quit;
  33.     if (returncode!=F10) goto AskOver;
  34. Quit:
  35.     delete_window(wnd);
  36.     rstrip(origin);
  37.     if (!*origin) strcpy(origin,temp);
  38.     return;
  39. }
  40.  
  41.  
  42.  
  43. char * pascal get_qstring (char *quotestring) {
  44.  
  45.     int returncode;
  46.     static char noquotes[2]="-";
  47.     WINDOW *wnd;
  48.     FIELD *fld;
  49.     char *pp;
  50.  
  51.     wnd=establish_window(3,maxy-7,7,36);
  52.     set_border(wnd,3);
  53.     set_title(wnd," Quote String ");
  54.     set_colors(wnd,BORDER,7,0,0);
  55.     display_window(wnd);
  56.     wcursor(wnd,0,0);
  57.     wprintf(wnd," F10 to change or ESC for default");
  58.  
  59.     memset(quotestring,0,10); /* Build quote string */
  60.     *quotestring=' ';
  61.     if(*msg.from) {
  62.           quotestring[1]=*msg.from;
  63.           pp=strchr(msg.from,' ');
  64.           if(pp && pp[1]) quotestring[2]=pp[1];
  65.     }
  66.     strcat(quotestring,"> ");
  67.  
  68. Again:
  69.     wprompt(wnd,3,2,"String:");
  70.     wprompt(wnd,3,3,"NoQuotes: [ ]");
  71.     fld=establish_field(wnd,11,2,msk11,quotestring,'a');
  72.     field_window(fld,"quotestrng",40,5);
  73.     fld=establish_field(wnd,14,3,msk1,noquotes,'O');
  74.     field_window(fld,"noquotes  ",40,6);
  75.     prep_template(wnd);
  76. AskOver:
  77.     returncode=data_entry(wnd);
  78.     if (returncode==ESC) {
  79.         delete_window(wnd);
  80.         return NULL;
  81.     }
  82.     if (returncode!=F10) goto AskOver;
  83. Quit:
  84.     delete_window(wnd);
  85.     if (*noquotes=='X') return "NOQUOTE";
  86.     rstrip(quotestring);
  87.     return quotestring;
  88. }
  89.  
  90.